<me:UIVAART x:Class="WPFExcelReport.TPFVA06"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"     
                    xmlns:me="clr-namespace:WPFExcelReport" 
                    xmlns:U="clr-namespace:WPFExcelReport;assembly=ITXUI" 
                    xmlns:SD="clr-namespace:WPFExcelReport;assembly=TSDDAT" 
                    xmlns:VAK="clr-namespace:WPFExcelReport;assembly=TVAKOLL" 
                    xmlns:WS="clr-namespace:WPFExcelReport;assembly=TWASTAMM" 
                    xmlns:DR="clr-namespace:WPFExcelReport;assembly=TDRAUFTR" 
                    xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls" 
                     xmlns:Localization="clr-namespace:Localization;assembly=Localization"
                     xmlns:TXT="clr-namespace:WPFExcelReport;assembly=TTXTIND"  
                    xmlns:VKK="clr-namespace:WPFExcelReport;assembly=TVKKOPF"  
                    xmlns:LS="clr-namespace:WPFExcelReport;assembly=TLIEFDAT"  
                    xmlns:VF="clr-namespace:WPFExcelReport;assembly=TVAFARBEN"  
                   x:Name="TV"
                    Loaded="Window_Loaded"
     >
    <me:UIVAART.Resources>
        <CollectionViewSource  x:Key="vwMaster"/>       <CollectionViewSource  x:Key="vwDetail"/>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:BoolToVisibilityConverter  x:Key="bv"/>
        <ucd:NOTBoolToVisibilityConverter  x:Key="nbv"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:NOTConverter  x:Key="not"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <ucd:TRIMGB2312Convert8859P1 x:Key="tgb"/>
        <ucd:TextTrimmingConverter x:Key ="trim"/>
    </me:UIVAART.Resources>

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="1*"></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="2*"></ColumnDefinition>
            <ColumnDefinition Width="1*"></ColumnDefinition>
        </Grid.ColumnDefinitions>
        <StackPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2">
            <WrapPanel    Margin="0,5,0,0">
                <Button  Click="QueryCommand" Height="20" Margin="5,0,0,0" Width="24" >
                    <Button.Background>
                        <ImageBrush  ImageSource="/ImagePackage;component/Images/Search.png" />
                    </Button.Background>
                </Button>
                <U:UIQTST 
                     KOLL="{Binding KOLL,ElementName=TV}"
                   ART="{Binding ART,ElementName=TV}"
                    VAR="{Binding VAR,ElementName=TV}" 
                   FARBE="{Binding FARBE,ElementName=TV}"
                  DES="{Binding DES,ElementName=TV}"  
                    PRODGRP="{Binding PRODGRP,ElementName=TV}"   
                />
            </WrapPanel>
        </StackPanel>
        <Grid Grid.Row="1" Grid.Column="0" >
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="Auto"></RowDefinition>
            </Grid.RowDefinitions>
            <Grid Grid.Row="0">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="1*"></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <StackPanel Grid.Row="0"  Grid.Column="0" >
                    <WrapPanel Margin="0,5,0,0"  VerticalAlignment="Top">
                        <Grid Margin="0,0,0,0"  VerticalAlignment="Top" >
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                            <Button   Click="NewCommand" Height="20" Margin="5,0,0,0" Width="24" Visibility="{Binding IsNew,Converter={StaticResource nbv}}" >
                                <Button.Background>
                                    <ImageBrush  ImageSource="/ImagePackage;component/Images/Add.png" />
                                </Button.Background>
                            </Button>
                            <Button   Click="NewCommand" Height="20" Margin="5,0,0,0" Width="24"  Visibility="{Binding IsNew,Converter={StaticResource bv}}" >
                                <Button.Background>
                                    <ImageBrush  ImageSource="/ImagePackage;component/Images/button_ok.png" />
                                </Button.Background>
                            </Button>
                        </Grid>
                        <Grid Margin="10,0,0,0" Visibility="{Binding IsEdit,Converter={StaticResource nbv}}"  VerticalAlignment="Top">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                            <Button   Click="EditCommand" Height="20" Margin="5,0,0,0" Width="24" >
                                <Button.Background>
                                    <ImageBrush  ImageSource="/ImagePackage;component/Images/Edit.png" />
                                </Button.Background>
                            </Button>
                        </Grid>
                        <Grid Margin="10,0,0,0" Visibility="{Binding IsEdit,Converter={StaticResource bv}}"  VerticalAlignment="Top">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                            <Button   Click="SaveCommand" Height="20" Margin="5,0,0,0" Width="24" >
                                <Button.Background>
                                    <ImageBrush  ImageSource="/ImagePackage;component/Images/Save.png" />
                                </Button.Background>
                            </Button>
                        </Grid>
                        <Grid Margin="10,0,0,0" Visibility="{Binding IsEdit,Converter={StaticResource bv}}" VerticalAlignment="Top">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                            <Button Click="DeleteCommand" Height="20" Margin="5,0,0,0" Width="24" >
                                <Button.Background>
                                    <ImageBrush  ImageSource="/ImagePackage;component/Images/remove.png" />
                                </Button.Background>
                            </Button>
                        </Grid>
                        <Grid Margin="10,0,0,0"  VerticalAlignment="Top">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                            <Button    Click="CopyCommand" Height="20" Margin="5,0,0,0" Width="24" >
                                <Button.Background>
                                    <ImageBrush  ImageSource="/ImagePackage;component/Images/copy.png" />
                                </Button.Background>
                            </Button>
                        </Grid>
                        <Grid Margin="10,0,0,0" VerticalAlignment="Top">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                            <DR:TDRAUFTR  Grid.Column="0" Name="cDR" 
                                           VerticalAlignment="Top"
                                          DocType="{Binding VALBTYP,ElementName=TV}" 
                                          PrintType="OpenExcel" />
                            <Button  Grid.Column="1"  Click="btnPrint_Click" Height="20"
                                      VerticalAlignment="Top"
                                     Margin="5,0,0,0" Width="Auto" Content="{Binding Source={Localization:Translate Word=打印标签}}" />
                        </Grid>
                        <Grid Margin="10,0,0,0" VerticalAlignment="Top">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                            <DR:TDRAUFTR  Grid.Column="0" Name="cDRVA06" 
                                           VerticalAlignment="Top"
                                           DocType="TSTVA06"   
                                           PrintType="OpenExcel" Visibility="Collapsed"/>
                            <Button  Grid.Column="1"  Click="btnPrintVA06_Click" Height="20"
                                      VerticalAlignment="Top"
                                     Margin="5,0,0,0" Width="Auto" Content="{Binding Source={Localization:Translate Word=导出Excel}}" />

                        </Grid>

                        <WrapPanel  Margin="0,5,0,0" Visibility="{Binding IsNew,ElementName=TV,Converter={StaticResource nbv}}">
                            <Grid Margin="10,0,0,0" VerticalAlignment="Top">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                                </Grid.ColumnDefinitions>
                                <TextBlock Text="{Binding Source={Localization:Translate Word=季节:}}"></TextBlock>
                                <TextBlock    Text="{Binding VAAKOLL,Source={StaticResource vwMaster}}"  Grid.Column="1"     Width="60" />
                            </Grid>
                            <Grid Margin="10,0,0,0" VerticalAlignment="Top">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                                </Grid.ColumnDefinitions>
                                <TextBlock Text="{Binding Source={Localization:Translate Word=产品组:}}"></TextBlock>
                                <TextBlock    Text="{Binding VAAPRGR,Source={StaticResource vwMaster}}"  Grid.Column="1"     Width="40" />
                            </Grid>
                            <Grid Margin="10,0,0,0" VerticalAlignment="Top">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                                </Grid.ColumnDefinitions>
                                <TextBlock Text="{Binding Source={Localization:Translate Word=品种组:}}"></TextBlock>
                                <TextBlock   Text="{Binding VAAARTGRP}"  Grid.Column="1"  Width="40" />
                            </Grid>
                        </WrapPanel>
                    </WrapPanel>
                    <me:VA07BOX
                          IsEdit="{Binding IsEdit,ElementName=TV}" 
                           IsNew="{Binding IsNew,ElementName=TV}"
                           IsSelfART="{Binding IsSelfART,ElementName=TV}"
                           KOLL="{Binding KOLL,ElementName=TV}" 
                             PRODGRP="{Binding PRODGRP,ElementName=TV}"  
                            ARTGRP="{Binding ARTGRP,ElementName=TV}"
                             NART="{Binding NART,ElementName=TV}"
                             IsSameProdArt="{Binding IsSameProdArt,ElementName=TV}" 
                             EXART="{Binding EXART,ElementName=TV}"
                             WSPRICE="{Binding WSPRICE,ElementName=TV}"
                             CURRENCY="{Binding CURRENCY,ElementName=TV}"
                               PRMEEH="{Binding PRMEEH,ElementName=TV}" 
                        />
                    <U:UVA07TST   
              IsEdit="{Binding IsEdit,ElementName=TV}" 
           IsNew="{Binding IsNew,ElementName=TV}"
           IsSelfART="{Binding IsSelfART,ElementName=TV}"
           KOLL="{Binding KOLL,ElementName=TV}" 
             PRODGRP="{Binding PRODGRP,ElementName=TV}"  
            ARTGRP="{Binding ARTGRP,ElementName=TV}"
             NART="{Binding NART,ElementName=TV}"
            FARBE="{Binding FARBE,ElementName=TV}" 
             IsSameProdArt="{Binding IsSameProdArt,ElementName=TV}" 
             EXART="{Binding EXART,ElementName=TV}"
             WSPRICE="{Binding WSPRICE,ElementName=TV}"
             CURRENCY="{Binding CURRENCY,ElementName=TV}"
               PRMEEH="{Binding PRMEEH,ElementName=TV}" 
              
                />
                </StackPanel>
                <!--me:UVALS Grid.Row="0" Grid.Column="1"/-->
            </Grid>
            <WS:TWASTAMM Grid.Row="1"
                    Margin="5,0,0,0" Name="cWS" 
                    IsAuto="True" 
                    DES="{Binding DES,ElementName=TV}"  
                    ARTGRP="{Binding ARTGRP,ElementName=TV}"  
                    PRODGRP="{Binding PRODGRP,ElementName=TV}"  
                    ORDERNUM="{Binding PRART,ElementName=TV}"
                    WALIEFNR="{Binding LIEFNR,ElementName=TV}"  
                    FBRTU="{Binding FBRTU,ElementName=TV}"  
                    FBRTL="{Binding FBRTL,ElementName=TV}"  
                    FGRLFD="{Binding FGRLFD,ElementName=TV}"  
                    FGRQM="{Binding FGRQM,ElementName=TV}"  
                    FFDDIK="{Binding FFDDIK,ElementName=TV}"  
                    FFDDIS="{Binding FFDDIS,ElementName=TV}"
                    FDDIM="{Binding FDDIM,ElementName=TV}"
                    IsEdit="{Binding IsEdit,ElementName=TV}" 
                    IsExtProd="{Binding IsExtProd,ElementName=TV}" 
                    IsShowRight="{Binding IsShowRight,ElementName=TV}"
                    IsImageMax="{Binding IsImageMax,ElementName=TV}" 
                    IMAGEPATH="{Binding IMAGEPATH,ElementName=TV}"
                    DEFTXT="{Binding DEFWSTXT,ElementName=TV}"/>
        </Grid>
        <U:LSTVATST Grid.Row="2" Grid.Column="0"   Grid.ColumnSpan="2"/> 
        <Grid Grid.Row="1" Grid.Column="1">
            <Grid.RowDefinitions>
                <RowDefinition Height="1*"/>
                <RowDefinition Height="1*"/>
            </Grid.RowDefinitions>
            <TXT:TXTITX Grid.Row="0" Margin="0,0,0,0"
                                 TART="WFT"
                                SIND="{Binding TXTISIND,ElementName=cWS}"  
                                 IsEdit="{Binding IsEdit,ElementName=cWS}"
                                  DEFTXT="{Binding DEFTXT,ElementName=cWS}"   
                                   VerticalAlignment="Top"/>
            <VF:TVA09  Grid.Row="1" Margin="0,5,0,0" 
                       IsAuto="True"
                       EXAUF="{Binding KEY,ElementName=TV}"/>
        </Grid>
        <ex:TPage  Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2" Visibility="{Binding IsPage,Converter={StaticResource bv}}"/>
        <Image  Name="cImage" Grid.Row="1" Grid.RowSpan="3" Grid.Column="0" Grid.ColumnSpan="2" 
               Visibility="{Binding IsImageMax,ElementName=cWS,Converter={StaticResource bv}}"
               Source="{Binding Path=PHOTOLINK, ElementName=cWS}" 
                  MouseLeftButtonDown="Image_MouseLeftButtonUp"
                Stretch="Uniform" 
       />

    </Grid>
</me:UIVAART>
